public class demo1 {
    public static void main2(String[] args) {
        int sum = 0, n = 100;
        sum = (1 + n) * n / 2;
        System.out.println(sum);

    }
    public static void main1(String[] args) {
        int sum = 0, n = 100;
        for (int i = 0; i <= n; i++) {
            sum += i;
        }
        System.out.println(sum);
    }
}
